package com.hhkj.study.admin.resource.excel;

import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.valid.VAdd;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author luowu
 * @Date 2024/9/25 涵 9:31:34
 */
@Data
public class ResourceQuestionBankExcelRes extends BaseExcelRes {
    /**
     * 名称
     */
    @Excel(name = "名称", width = 20, needMerge = true, require = true)
    @NotBlank(message = "名称不能为空或错误")
    private String name;
    /**
     * 课程小类,字典表中id
     */
    @Excel(name = "课程类型", width = 20, needMerge = true, customDictType = "courseTypeCode", needFilterStr = StrUtil.DASHED, require = true)
    @NotNull(message = "课程小类不能为空或错误")
    private Long courseType;
    /**
     * 题库类型,字典表中id
     */
    @NotNull(message = "题库类型不能为空或错误")
    @Excel(name = "题库类型", width = 20, needMerge = true, customDictType = "bankTypeCode", require = true)
    private Long type;
    /**
     * 关联建培圈题库id
     */
    private Long assoBankId;
    /**
     * 关联建培圈题库名称
     */
    @NotBlank(message = "关联建培圈题库名称不能为空或错误")
    @Excel(name = "关联建培圈题库名称", width = 20, needMerge = true, type = Excel.Type.EXPORT, require = true)
    private String assoBankName;
    /**
     * 年份
     */
    private String year;
    /**
     * 题目总数
     */
    private Integer questionCount;
    /**
     * 说明
     */
    @Excel(name = "说明", width = 20, needMerge = true)
    private String remark;
    /**
     * 是否展示（0-上架， 1-下架）
     */
    @Excel(name = "上下架状态", width = 20, needMerge = true, readConverterExp = "0=否,1=是", combo = {"是","否"})
    private Integer publishedFlag;

    @Override
    public Long getResourceCourseType() {
        return this.courseType;
    }

    @Override
    public String getTitle() {
        return "题库导入模板\n" +
                "1、表头红色加粗为必填字段";
    }

    @Override
    public String getSheetName() {
        return "题库导入模板";
    }
}
